package cn.izeno.wx.web

import cn.izeno.wx.models.web.BaseMessage
import cn.izeno.wx.models.web.BaseParam
import cn.izeno.wx.models.web.SendMsgParam
import cn.izeno.wx.service.Web
import java.util.logging.Logger

object MessageSender {
  private val logger = Logger.getLogger("cn.izeno.wx.web.MessageSender")

  fun send(msg: BaseMessage) {
    Web.service.sendMsg(body = SendMsgParam(msg)).subscribe({
      //      logger.info("消息发送成功")
    }, {
      logger.warning("消息发送失败")
    })
  }
}